package cn.pku.eecs.ldn.activity;

import cn.pku.eecs.ldn.R;
import android.app.ListActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Adapter;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.ListAdapter;
import android.widget.ListView;

public class ListActivityExampleActivity extends ListActivity{
	private static final String[] CHOICES = new String[] {
		"Open website example",
		"Open contacts example",
		"Open phone dialer example",
		"Search google example",
		"Start voice command"
	};
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		ListAdapter arrayAdapter = new ArrayAdapter<String>(this, R.layout.list_simple_item, CHOICES);
		setListAdapter(arrayAdapter);
		getListView().setChoiceMode(ListView.CHOICE_MODE_SINGLE);
		getListView().setTextFilterEnabled(true);
		getListView().setOnItemClickListener(new OnItemClickListener(){

			@Override
			public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
					long arg3) {
				// TODO Auto-generated method stub
				
			}
		});
	}
}
